package com.epoch.zuul.auth.controller;

import bean.response.ResponseBean;
import com.epoch.zuul.auth.service.AuthService;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author admin
 */
@Slf4j
@RestController
public class AuthController {

    @Autowired
    private AuthService authService;


    @RequiresPermissions("auth:get")
    @PostMapping("epoch/auth/getAuthByAuthId")
    public ResponseBean getAuthByAuthId(@RequestParam("authId") Integer authId){
        return authService.getAuthByAuthId(authId);
    }

    @RequiresPermissions("auth:getList")
    @GetMapping("epoch/auth/getAllAuths")
    public ResponseBean getAllAuths(){
        return authService.getAllAuths();
    }

}
